A memory device having a three-dimensional structure has been proposed in which memory holes are formed in a stacked body in which multiple electrode layers are stacked, and a charge storage film and a semiconductor film are provided to extend in the stacking direction of the stacked body inside the memory hole. The memory device has multiple memory cells connected in series between a drain-side selection transistor and a source-side selection transistor. The electrode layers of the stacked body are word lines and selection gates. The stacked body has a stairstep portion at the end portion of the stacked body. The stairstep portion includes multiple terraces. The terraces are the portions of the electrode layers drawn out to the outer side of the stacked body. Contacts that connect the electrode layers to a memory peripheral circuit are provided at the terraces. Therefore, the planar sizes of the terraces easily become large and impede downscaling of the memory device. It is desirable to reduce the planar size of the stairstep portion.